/* Octopus PDF - A simple document viewer for Android.
   Copyright (C) 2013  Gerald Thaler

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>. */
package de.geraldthaler.octopuspdf.view;

import android.view.MotionEvent;

/**
 * @author Gerald Thaler
 */
public final class Fling {
    private final float duration;
    private final float velocityX;
    private final float velocityY;

    public Fling(final MotionEvent e1, final MotionEvent e2, final float velocityX, final float velocityY) {
        this.duration = (e2.getEventTime() - e1.getEventTime()) * 1e-3f;
        this.velocityX = velocityX;
        this.velocityY = velocityY;
    }

    public float getDuration() {
        return duration;
    }

    public float getVelocityX() {
        return velocityX;
    }

    public float getVelocityY() {
        return velocityY;
    }
}
